3.194 \(\int (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=19 \[ a x+\frac {b \tan (e+f x)}{f}-b x \]

[Out]

a*x-b*x+b*tan(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3473, 8} \[ a x+\frac {b \tan (e+f x)}{f}-b x \]

Antiderivative was successfully verified.

[In]

Int[a + b*Tan[e + f*x]^2,x]

[Out]

a*x - b*x + (b*Tan[e + f*x])/f

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rubi steps

\begin {align*} \int \left (a+b \tan ^2(e+f x)\right ) \, dx &=a x+b \int \tan ^2(e+f x) \, dx\\ &=a x+\frac {b \tan (e+f x)}{f}-b \int 1 \, dx\\ &=a x-b x+\frac {b \tan (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 28, normalized size = 1.47 \[ a x-\frac {b \tan ^{-1}(\tan (e+f x))}{f}+\frac {b \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[a + b*Tan[e + f*x]^2,x]

[Out]

a*x - (b*ArcTan[Tan[e + f*x]])/f + (b*Tan[e + f*x])/f

________________________________________________________________________________________

fricas [A]  time = 0.40, size = 21, normalized size = 1.11 \[ \frac {{\left (a - b\right )} f x + b \tan \left (f x + e\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(f*x+e)^2,x, algorithm="fricas")

[Out]

((a - b)*f*x + b*tan(f*x + e))/f

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(f*x+e)^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)b*(-4*f*x*tan(exp(1))*tan(f*x)+4*f*x-pi*sign(2*tan(exp(1))^2*tan(f*x)+2*tan(exp(1))*
tan(f*x)^2-2*tan(exp(1))-2*tan(f*x))*tan(exp(1))*tan(f*x)+pi*sign(2*tan(exp(1))^2*tan(f*x)+2*tan(exp(1))*tan(f
*x)^2-2*tan(exp(1))-2*tan(f*x))-pi*tan(exp(1))*tan(f*x)+pi+2*atan((tan(exp(1))*tan(f*x)-1)/(tan(exp(1))+tan(f*
x)))*tan(exp(1))*tan(f*x)-2*atan((tan(exp(1))*tan(f*x)-1)/(tan(exp(1))+tan(f*x)))+2*atan((tan(exp(1))+tan(f*x)
)/(tan(exp(1))*tan(f*x)-1))*tan(exp(1))*tan(f*x)-2*atan((tan(exp(1))+tan(f*x))/(tan(exp(1))*tan(f*x)-1))-4*tan
(exp(1))-4*tan(f*x))/(4*f*tan(exp(1))*tan(f*x)-4*f)+a*x

________________________________________________________________________________________

maple [A]  time = 0.03, size = 29, normalized size = 1.53 \[ a x +\frac {b \tan \left (f x +e \right )}{f}-\frac {\arctan \left (\tan \left (f x +e \right )\right ) b}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*tan(f*x+e)^2,x)

[Out]

a*x+b*tan(f*x+e)/f-1/f*arctan(tan(f*x+e))*b

________________________________________________________________________________________

maxima [A]  time = 0.79, size = 23, normalized size = 1.21 \[ a x - \frac {{\left (f x + e - \tan \left (f x + e\right )\right )} b}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(f*x+e)^2,x, algorithm="maxima")

[Out]

a*x - (f*x + e - tan(f*x + e))*b/f

________________________________________________________________________________________

mupad [B]  time = 11.44, size = 21, normalized size = 1.11 \[ \frac {b\,\mathrm {tan}\left (e+f\,x\right )+f\,x\,\left (a-b\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a + b*tan(e + f*x)^2,x)

[Out]

(b*tan(e + f*x) + f*x*(a - b))/f

________________________________________________________________________________________

sympy [A]  time = 0.14, size = 20, normalized size = 1.05 \[ a x + b \left (\begin {cases} - x + \frac {\tan {\left (e + f x \right )}}{f} & \text {for}\: f \neq 0 \\x \tan ^{2}{\relax (e )} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(f*x+e)**2,x)

[Out]

a*x + b*Piecewise((-x + tan(e + f*x)/f, Ne(f, 0)), (x*tan(e)**2, True))

________________________________________________________________________________________